@import '~antd/es/style/themes/default.less';
@pagination-item-bg-active: @primary-color;
@searchBgColor: @component-background;
@searchFootColor: transparent;
@searchFooterBgColor: @component-background;
@searchTitleColor: @primary-3;
@table-bg-color: @component-background;
@pagination-bg-color: @component-background;
@pagination-text-color: @pagination-bg-color;
@pagination-margin: 5px;
@error-info-bg: #fff1f0;
@menu-width: 210px;
@menu-collapsed-width: 80px;
@whole-margin-left: 20px;
@whole-page-top: 8px;
@form-group-head-color: #666;
@form-group-circle-bg-color: @primary-color;
@form-item-label-color: #787B8B;
@form-item-disabled-bg-color: #D3D4D7;
@form-item-radius: 5px;
@form-group-gap: 20px;
/**
 * @name asset/constant.less
 * @desc 系统页面css常量和方法
 * @author yangliu at 2020-02-17
 *
 */
// 背景色渐变
.bg-linear(@start: @linear-start, @end: @linear-end) {
    background: -webkit-linear-gradient(right, @start, @end);
    background: -webkit-linear-gradient(right, @start, @end);
    /* Safari 5.1 to 6.0 */
    background: -o-linear-gradient(right, @start, @end);
    /* Opera 11.1 to 12.0 */
    background: -moz-linear-gradient(right, @start, @end);
    /* Firefox 3.6 to 15 */
    background: linear-gradient(to right, @start, @end);
    /* 标准语法 */
}

// border-image-linear
.border-image-linear(@border-text, @start, @middle, @end) {
    border-image: -webkit-linear-gradient(to right, @border-text, @start, @middle, @end) 1 10;
    border-image: -moz-linear-gradient(to right, @border-text, @start, @middle, @end) 1 10;
    border-image: linear-gradient(to right, @border-text, @start, @middle, @end) 1 10;
}

// 树的border(purple theme)
.tree-border(@border-text: @primary-color, @start: #6879CE, @middle: #6FD0F4, @end: #88ECED) {
    border-top: 6px solid;
    .border-image-linear(@border-text, @start, @middle, @end);
}

// 重置的样式(purple theme)
.reset-btn() {
    .bg-linear(#9a9a9a, #bebdbe);
    color: @white;

    &:hover {
        opacity: .7;
    }
}

// 水平垂直居中
.ab-center() {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

// table的操作按钮样式
.tb-edit() {
    cursor: pointer;

    .anticon {
        font-size: 22px;
    }

    &:not(:first-child) {
        padding-left: 6px;
    }

    &:not(:last-child) {
        padding-right: 6px;
    }

    &.disabled {
        cursor: not-allowed;

        .anticon {
            color: @disabled-color;
        }

        .text {
            color: @disabled-color;
        }
    }
}

// 自定义menu的icon
.icon-setting(@name, @theme) {
    &.@{name} {
        // (主题切换带变量的url解析不到）所以只有在每个主题页面自己加；
        // background-image: url('./icons/@{theme}-@{name}.png');
    }
}

// 背景设置
.bg-rgba(@alpha, @colors1, @colors2, @colors3) when (isnumber(@colors1)) {
    background-color: rgba(@colors1, @colors2, @colors3, @alpha);
}

.bg(@color) when (iscolor(@color)) {
    background: @color;
    background-color: @color;
}

// 主题切换解析不到url，暂不用
// .bg(@url) when (isurl(@url)) {
//     background-image: @url;
// }

.border-radius(@radius) {
    -webkit-border-radius: @radius;
    -moz-border-radius: @radius;
    border-radius: @radius;
}